package net.uhuijia.sys.sysversion.service.impl;

import net.uhuijia.constants.DBConst;
import net.uhuijia.enums.SysVersionTypeEnum;
import net.uhuijia.vo.sys.sysversion.SysVersionParam;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import net.uhuijia.appbase.service.CrudService;
import net.uhuijia.sys.sysversion.persistence.dao.SysVersionDao;
import net.uhuijia.sys.sysversion.persistence.model.SysVersion;
import net.uhuijia.sys.sysversion.persistence.model.SysVersionExample;
import net.uhuijia.sys.sysversion.service.SysVersionService;


@Service
@Transactional
public class SysVersionServiceImpl
     extends CrudService<SysVersionDao,SysVersion,SysVersionExample>
     implements  SysVersionService {
    @Override
    public SysVersion getProjectAndroidVersion(String project) {
        SysVersionParam sysVersionParam = new SysVersionParam();
        sysVersionParam.setProject(project);
        sysVersionParam.setType(SysVersionTypeEnum.ANDROID.getType());
        sysVersionParam.setIsEffective(DBConst.TRUE);
        sysVersionParam.setIsUsed(DBConst.TRUE);
        return mapper.getProjectVersion(sysVersionParam);
    }

    @Override
    public SysVersion getProjectIosVersion(String project) {
        SysVersionParam sysVersionParam = new SysVersionParam();
        sysVersionParam.setProject(project);
        sysVersionParam.setType(SysVersionTypeEnum.IOS.getType());
        sysVersionParam.setIsEffective(DBConst.TRUE);
        sysVersionParam.setIsUsed(DBConst.TRUE);
        return mapper.getProjectVersion(sysVersionParam);
    }
}